<template>
  <view class="smart-container">

    <!-- 容器类相关（保留另一分支的组件分类列表） -->
    <view class="smart-panel-title">1. 容器</view>
    <view class="smart-panel-h" @click="goDetailPage('view')">view 视图</view>
    <view class="smart-panel-h" @click="goDetailPage('scroll-view')">scroll-view 滚动视图</view>
    <view class="smart-panel-h" @click="goDetailPage('swiper')">swiper 可滑动视图</view>

    <!-- 基础内容类 -->
    <view class="smart-panel-title">2. 基础内容</view>
    <view class="smart-panel-h" @click="goDetailPage('text')">text 文本</view>
    <view class="smart-panel-h" @click="goDetailPage('rich-text')">rich-text 富文本</view>
    <view class="smart-panel-h" @click="goDetailPage('progress')">progress 进度条</view>

    <!-- 表单组件类 -->
    <view class="smart-panel-title">3. 表单组件</view>
    <view class="smart-panel-h" @click="goDetailPage('button')">button 按钮</view>
    <view class="smart-panel-h" @click="goDetailPage('radio')">radio 单选框</view>
    <view class="smart-panel-h" @click="goDetailPage('checkbox')">checkbox 多选框</view>
    <view class="smart-panel-h" @click="goDetailPage('input')">input 输入控件</view>
    <view class="smart-panel-h" @click="goDetailPage('picker')">picker 选择列表</view>
    <view class="smart-panel-h" @click="goDetailPage('slider')">slider 滑块</view>
    <view class="smart-panel-h" @click="goDetailPage('switch')">switch 开关</view>
    <view class="smart-panel-h" @click="goDetailPage('textarea')">textarea 多行文本输入</view>
    <view class="smart-panel-h" @click="goDetailPage('form')">form 表单</view>

    <!-- 导航类 -->
    <view class="smart-panel-title">4. 导航</view>
    <view class="smart-panel-h" @click="goDetailPage('navigator')">navigator 导航</view>


  </view>
</template>

<script>
export default {
  data() {
    return {};
  },
  methods: {
    // 保留另一分支的“跳转到组件详情页”方法
    goDetailPage(type) {
      // 若需实际跳转，取消注释下方代码（需先创建detail页面）
      // uni.navigateTo({ url: `/pages/detail/detail?type=${type}` });
      console.log(`即将前往 ${type} 相关页面`);
    },
    // 新增：跳转到登录页的方法
    gotoLogin() {
      uni.navigateTo({
        url: "/pages/login/index" // 需与 pages.json 中登录页路径一致
      });
    }
  }
};
</script>

<style>
.smart-container {
  padding: 10px;
}
.smart-panel-title {
  font-size: 16px;
  font-weight: bold;
  margin: 10px 0;
}
.smart-panel-h {
  margin: 5px 0;
  padding: 5px;
  background-color: #f5f5f5;
  border-radius: 4px;
  /* 新增： hover效果，提升交互体验 */
  transition: background-color 0.2s;
}
.smart-panel-h:hover {
  background-color: #e8e8e8;
}
/* 新增：跳转按钮的样式 */
.goto-login-btn {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}
</style>
